package com.fieldchain.ex.fa100.utils.string;

/**
 * Created by 123 on 2018/5/22.
 */

public class StringFormateUtils {
    public static String getHalfHidenString(String str) {
        if (str == null || str.length() == 0 || str.length() < 8) {
            return "";
        } else {
            String s = "****";
            StringBuilder sb = new StringBuilder(str);
            sb.replace(3, 7, s);
            return sb.toString();
        }
    }

    public static boolean unEmpty(String str) {
        if (str == null) return false;
        if (str.length() == 0) return false;
        return true;
    }

    public static boolean unEmpty(String[] str) {
        if (str == null) return false;
        if (str.length == 0) return false;
        for(int i=0;i<str.length;i++) {
            if (str[i] == null) return false;
            if (str[i].length() == 0) return false;
        }
        return true;
    }
}
